<%@page contentType="text/html;charset=utf-8"%>
<!-- 修改用户页面 -->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>用户更新</title>
<link rel="stylesheet" type="text/css" href="css\create.css">
<script type="text/javascript" src="js/jquery-3.4.1.min.js"></script>
<script type="text/javascript" src="js/validation.js"></script>
<script type="text/javascript">
	<!-- 提交前表单校验 -->
	function checkSubmit(){
		var result = true;
		var r1 = checkEmpty("#pname","#errPname");
		var r2 = checkCategory('#category', '#errCategory');
		var r3 = checkPrice('#price', '#errPrice');
		var r4 = checkFile('#painting', '#errPainting');
		var r5 = checkEmpty('#description', '#errDescription');
		if (r1 && r2 && r3 && r4 && r5){
			return true;
		}else{
			return false;
		}
	}
</script>
</head>
<body>
	<div class="container">
		<fieldset>
			<legend>修改用户信息</legend>
			<form action="/management?method=uupdate" method="post"
			autocomplete="off" enctype="multipart/form-data"
            onsubmit = "return checkSubmit()">
                <ul class="ulform">
                    <li>
                        <span>用户头像</span><span id="errPainting"></span><br/>
                        <img id="preview" src="/upload/1.jpg" style="width:210px;height:170px"/><br/>
                        <input id="user_head" name="user_head" type="file" style="padding-left:0px;" accept="image/*"/>
                    </li>
                    <li>
                        <input type="hidden" name="user_id"   required="required" id="user_id" onfocus="showTips('user_id','用户名必填！')" onblur="check('user_id','用户名不能为空！')">
                        <span id="user_idspan"></span><br/>
                    </li>
                    <li>
                        <span>用户昵称</span>
                        <input type="text" name="user_name" value="${user.user_name }" maxlength="10"  required="required" id="user_name" onfocus="showTips('user_name','用户名必填！')" onblur="check('user_name','用户名不能为空！')">
                        <span id="user_namespan"></span><br/>
                    </li>
                    <li>
                        <span>用户密码</span>
                        <input type="text" name="user_pwd" value="${user.user_pwd }" maxlength="10"  id="user_pwd" onfocus="showTips('user_pwd','用户密码必填！')" onblur="check('user_pwd','用户密码不能为空！')">
                        <span id="user_pwdspan"></span><br/>
                    </li>
                    <li>
                        <span>用户性别</span>
                        <input type="text" name="user_sex" value="${user.user_sex }" maxlength="10"  id="user_sex" onfocus="showTips('user_sex','用户性别必填！')" onblur="check('user_sex','用户性别不能为空！')">
                        <span id="user_sexspan"></span><br/>
                    </li>
                    <li>
                        <span>账户余额</span>
                        <input type="text" name="user_salary" value="${user.user_salary }" maxlength="10"  id="user_salary" onfocus="showTips('user_salary','账户余额必填！')" onblur="check('user_salary','账户余额不能为空！')">
                        <span id="user_salaryspan"></span><br/>
                    </li>
                    <li>
                        <span>用户联系方式</span>
                        <input type="text" name="user_tel" value="${user.user_tel }" maxlength="10"  id="user_tel">
                        <span id="user_telspan"></span><br/>
                    </li>
                    <li>
                        <span>用户地址</span>
                        <input type="text" name="user_addr" value="${user.user_addr }" maxlength="10"  id="user_addr">
                        <span id="user_addrspan"></span><br/>
                    </li>
                    <li style="text-align: center;">
                        <input type="hidden" id="id" name="id">
                        <input type="submit" class="btn-button" value="提交表单">
                    </li>
                </ul>
			</form>
		</fieldset>
	</div>

</body>
</html>
